﻿/*-------------------------------------------------------------------------
* 命名空间: SiliconSelect.Base/MsgErrorType
* 类       名: MsgErrorType
* 功      能:  TD
* 时      间:  2023/7/17 10:03:29
* 版      本:  V1.0
* 作      者:  Fioman
* 格      言:  Talk is cheap,show me the code ^_^
*-------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SiliconSelect.Base
{
    public class MsgErrorHelperPc
    {
        public static Dictionary<string, string> MsgErrorTypeDictionary = new Dictionary<string, string>()
        {
            {"00","3D工位误触发" },
            {"01","连片" },
            {"02","反向" },
            {"03","遮挡" },
            {"04","碎片" },
            {"05","错位" },
            {"06","PLC通讯异常" },
            {"07","3D数据错乱" }
        };
        /// <summary>
        /// 根据ErrorCode(错误码)获取对应的具体的错误消息
        /// </summary>
        /// <param name="errorCode"></param>
        public static string GetErrorInfoByCode(string errorCode)
        {
            string defaultVal = "消息错误码不在错误码提供的字典中";
            string? value;
            if (MsgErrorTypeDictionary.TryGetValue(errorCode, out value))
            {
                return value;
            }
            else
            {
                return defaultVal;
            }
        }
    }
}
